<!--菜单展开或者收起图标-->
<script lang="ts" setup>
import useThemeStore from '@/store/theme.ts'
import {storeToRefs} from 'pinia'

const themeStore = useThemeStore()
const {isCollapse} = storeToRefs(themeStore)

const collapse = () => {
	themeStore.setCollapse(!isCollapse.value)
}
</script>

<template>
	<el-icon class="collapse-icon" @click="collapse">
		<component :is="isCollapse ? 'expand' : 'fold'"/>
	</el-icon>
</template>

<style lang="scss" scoped>
.collapse-icon {
	margin-right: 20px;
	font-size: 22px;
	cursor: pointer;
}
</style>
